home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / jdk / readme < prev    next >
Encoding:
Text File  |  1995-12-11  |  7.9 KB  |  243 lines

  1.                  README: The Java Developers Kit
  2.  
  3.  
  4. This Beta 2 release of the Java Developers Kit (JDK) lets you
  5. write applets that conform to the new, frozen Java applet API.  
  6.  
  7.  
  8. The JDK helps you to:
  9. ---------------------
  10.     - Develop applets that conform to the final applet API
  11.     - Create applets that run in all Java-enabled browsers
  12.     - Develop Java applications
  13.     - Experiment with the debugger API (and a prototype
  14.       command-line debugger)
  15.  
  16.  
  17. Supported platforms
  18. -------------------
  19. The JDK is available for SPARC Solaris, Windows NT, and Windows 95.
  20.   
  21.  
  22. The JDK contains:
  23. -----------------
  24.     - Java Applet Viewer, 
  25.            for testing and running applets
  26.  
  27.     - Java Debugger API and Prototype Debugger,
  28.              an API (java.tools.debug) and early prototype
  29.              of a command-line debugger that uses the API
  30.  
  31.     - Java Compiler
  32.  
  33.     - Java Interpreter
  34.         
  35. NOTE: This release does NOT include a Web browser. 
  36.  
  37.  
  38. What is the final applet API?
  39. ------------------------------
  40. The final applet API consists of the following packages:  java.lang,
  41. java.util, java.io, java.net, java.awt, java.awt.peer, java.awt.image,
  42. and java.applet.  We and our partners are committed to supporting
  43. this API.
  44.  
  45.  
  46. ----------------------------------------------------------------------
  47. IMPORTANT: Please make sure you understand the Copyright and License
  48. information (in the file named COPYRIGHT) before using this release.
  49. ----------------------------------------------------------------------
  50.  
  51.  
  52. The rest of this document has the following sections:
  53.  
  54. - How to unpack the source
  55. - Where to find more information
  56. - Running applets with the Applet Viewer
  57. - The APPLET tag
  58. - Debugging programs with JDB
  59.  
  60.  
  61. How to unpack the source
  62. ------------------------
  63.  
  64. The source for the java.* classes is included as src.zip in the top level
  65. directory.  Unzip the file to view the sources.
  66.  
  67.  
  68. Where to find more information
  69. ------------------------------
  70. This file is the only documentation included in this release.  The
  71. rest of the information you need is on our website:
  72.  
  73.     http://java.sun.com/JDK-beta2/
  74.  
  75. It includes the following:
  76.  
  77. - Frequently asked questions
  78. - Changes since the last release
  79. - Applet examples (some of which are in this release, as well)
  80. - API documentation 
  81. - Documentation for the Java programming tools (including java,
  82.   javac, and jdb)
  83. - The latest Java Language Specification 
  84. - Known bugs in the JDK 
  85.  
  86. If you have questions, problems, or comments:
  87.  
  88. 1. Check out the FAQ at:
  89.  
  90.     http://java.sun.com/JDK-beta2/faq.html
  91.  
  92. 2. Before filing a bug report, please check the known bugs at:
  93.  
  94.     http://java.sun.com/JDK-beta2/KnownBugs-JDK.html
  95.  
  96.    File bug reports using the form at:
  97.  
  98.     http://java.sun.com/GettingInTouch/BugReport.html
  99.  
  100. 3. The newsgroup comp.lang.java and the Java/HotJava mailing lists 
  101.    are active forums for posting questions and exchanging information 
  102.    with other Java users.  See http://java.sun.com/mail.html for 
  103.    information on accessing the newsgroup and mailing lists.
  104.  
  105. 4. Other questions can be sent to java@java.sun.com.
  106.  
  107.  
  108. Running applets with the Applet Viewer
  109. --------------------------------------
  110. Here are two examples of using the Applet Viewer:
  111.  
  112.   bin/appletviewer demo/GraphLayout/example1.html
  113.   bin/appletviewer http://java.sun.com/applets/applets/NervousText/example1.html 
  114.   (On the PC, use "bin\appletviewer" instead of "bin/appletviewer".)
  115.  
  116. The argument is a filename or URL that refers to an HTML file that
  117. contains one or more APPLET tags.  The Applet Viewer finds the APPLET
  118. tags in the HTML file and runs the applets as specified by the tags
  119. (in separate windows).
  120.  
  121.  
  122. The APPLET tag
  123. --------------
  124. The APP tag of previous releases is gone, replaced by the APPLET tag. 
  125. Here is an example of a simple APPLET tag:
  126.  
  127.   <applet code="MyApplet.class" width=100 height=140></applet>
  128.  
  129. This tells the viewer or browser to load the applet whose compiled
  130. code is in MyApplet.class (in the same directory as the current HTML
  131. document), and to set the initial size of the applet to 100 pixels
  132. wide and 140 pixels high.
  133.  
  134. Here's a more complex example of an APPLET tag:
  135.  
  136.   <applet codebase="http://java.sun.com/applets/applets/NervousText"
  137.     code="NervousText.class" width=400 height=75 align=center >
  138.   <param name="text" value="This is the Applet Viewer.">
  139.   <blockquote>
  140.   <hr>
  141.   If you were using a Java-enabled browser,
  142.   you would see dancing text instead of this paragraph.
  143.   <hr>
  144.   </blockquote>
  145.   </applet>
  146.  
  147. This tells the viewer or browser to load the applet whose compiled
  148. code is at the URL
  149. http://java.sun.com/applets/applets/NervousText/NervousText.class,
  150. to set the initial size of the applet to 400x75 pixels, and to align
  151. the applet in the center of the line.  The viewer/browser must also
  152. set the applet's "text" attribute (which customizes the text this
  153. applet displays) to be "This is the Applet Viewer."  If the page is
  154. viewed by a browser that can't execute Java applets, then the browser
  155. will ignore the APPLET and PARAM tags, displaying the HTML between
  156. the <blockquote> and </blockquote> tags.  Java-enabled browsers
  157. *ignore* that HTML.
  158.  
  159. Here's the complete syntax for the APPLET tag:
  160.  
  161.     '<' 'APPLET'
  162.         ['CODEBASE' '=' codebaseURL]
  163.         'CODE' '=' appletFile
  164.     ['ALT' '=' alternateText]
  165.     ['NAME' '=' appletInstanceName]
  166.     'WIDTH' '=' pixels 'HEIGHT' '=' pixels
  167.     ['ALIGN' '=' alignment]
  168.     ['VSPACE' '=' pixels] ['HSPACE' '=' pixels]
  169.     '>'
  170.     ['<' 'PARAM' 'NAME' '=' appletAttribute1 'VALUE' '=' value '>']
  171.     ['<' 'PARAM' 'NAME' '=' appletAttribute2 'VALUE' '=' value '>']
  172.     . . .
  173.     [alternateHTML]
  174.     '</APPLET>'
  175.  
  176. 'CODEBASE' '=' codebaseURL
  177.     This optional attribute specifies the base URL of the applet --
  178.     the directory that contains the applet's code.  If this attribute
  179.     is not specified, then the document's URL is used.
  180.  
  181. 'CODE' '=' appletFile
  182.     This required attribute gives the name of the file that contains
  183.     the applet's compiled Applet subclass.  This file is relative to
  184.     the base URL of the applet.  It cannot be absolute.
  185.     
  186. 'ALT' '=' alternateText
  187.     This optional attribute specifies any text that should be
  188.     displayed if the browser understands the APPLET tag but can't
  189.     run Java applets.
  190.  
  191. 'NAME' '=' appletInstanceName
  192.     This optional attribute specifies a name for the applet instance,
  193.     which makes it possible for applets on the same page to find (and
  194.     communicate with) each other.
  195.  
  196. 'WIDTH' '=' pixels 'HEIGHT' '=' pixels
  197.     These required attributes give the initial width and height (in
  198.     pixels) of the applet display area, not counting any windows or
  199.     dialogs that the applet brings up.  
  200.  
  201. 'ALIGN' '=' alignment
  202.     This required attribute specifies the alignment of the applet.
  203.     The possible values of this attribute are the same as those for
  204.     the IMG tag: left, right, top, texttop, middle, absmiddle,
  205.     baseline, bottom, absbottom.
  206.  
  207. 'VSPACE' '=' pixels 'HSPACE' '=' pixels
  208.     These option attributes specify the number of pixels above and
  209.     below the applet (VSPACE) and on each side of the applet (HSPACE).
  210.     They're treated the same way as the IMG tag's VSPACE and HSPACE
  211.     attributes.
  212.  
  213. '<' 'PARAM' 'NAME' '=' appletAttribute1 'VALUE' '=' value '>' . . .
  214.     This tag is the only way to specify an applet-specific attribute.
  215.     Applets access their attributes with the getParameter() method.
  216.  
  217.  
  218. Debugging programs with JDB
  219. ---------------------------
  220. This release contains the Java Debugger (JDB), an alpha-quality
  221. prototype of a command-line debugger for Java classes.  It is
  222. designed to test the Java Debugger API, which is in the package
  223. java.tools.debug.  We look forward to getting your feedback on
  224. the debugger API.
  225.  
  226. You can debug applets using the -debug option of appletviewer.
  227. When debugging applets, it's best to invoke appletviewer from
  228. the directory that contains the applet's HTML file.  For example,
  229. on Solaris:
  230.  
  231.     cd demo/TicTacToe
  232.     ../../bin/appletviewer -debug example1.html 
  233.  
  234. On the PC:
  235.  
  236.     cd demo\TicTacToe
  237.     ..\..\bin\appletviewer -debug example1.html 
  238.     
  239. You can find documentation on the debugger and its API at:
  240.  
  241.     http://java.sun.com/JDK-beta2/debugging/
  242.  
  243.